const switchEl = document.getElementById('switch');
const scriptAEl = document.getElementById('script-a');
const scriptBEl = document.getElementById('script-b');

switchEl.addEventListener('change', function () {
    if (this.checked) {
        scriptAEl.remove();
        document.body.appendChild(scriptBEl);
    } else {
        scriptBEl.remove();
        document.body.appendChild(scriptAEl);
    }
});